<template>
  <el-date-picker
    v-model="pickTimeChoose"
    :picker-options="pickerOptions"
    :clearable="false"
    type="daterange"
    range-separator="至"
    start-placeholder="开始日期"
    end-placeholder="结束日期"
    align="right"
    value-format="yyyy-MM-dd"/>
</template>

<script>
import { pickerOptions, pickTime } from '@/model/DateRange'

export default {
  name: 'DatePicker',
  props: {
    value: {
      type: Array,
      default: function() { return pickTime }
    }
  },
  data() {
    return {
      pickTimeChoose: this.value,
      pickerOptions: pickerOptions
    }
  },
  watch: {
    pickTimeChoose() {
      this.$emit('input', this.pickTimeChoose)
    }
  }

}
</script>

